'use strict';
const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';

const RESOURCES = {"assets/AssetManifest.bin": "57943d93d9ee7bb3c7adace250a03bea",
"assets/AssetManifest.json": "2e65c89d6de285c5ea4c73d3ea998816",
"assets/assets/data/apple_record_type_data.json": "da4f6602a72739ec898d7f97a3f93696",
"assets/assets/data/balance_record_type_data.json": "259a18ff8efbeb48a3093ca6076106de",
"assets/assets/data/bonus_record_type_data.json": "b6263ed0e18d46ef54283e9d8fb4fbf8",
"assets/assets/data/member_rule.json": "d2d345665147285d1ef4a704e84ff6a5",
"assets/assets/data/member_type_data.json": "93d1fde1d9e48fbbd3d5039638c68227",
"assets/assets/data/pay_select_data_all.json": "824bec821413c59d8eec50f455bd83d0",
"assets/assets/data/pay_select_data_balance.json": "efb1cb74ced3134e922602e815b431b7",
"assets/assets/data/pay_select_data_default.json": "804dff8b95e069dbaa34ba395cfa4dfd",
"assets/assets/data/pay_select_data_normal.json": "574510efee31ad96276f2036f1c8de00",
"assets/assets/data/service_gold_data.json": "b0e14a9b2d64b834bf4a856995609d1d",
"assets/assets/data/service_normal_data.json": "9bb53b92535521af9bb8a291dc497774",
"assets/assets/data/tree_rule_high.json": "48fe38be2da43e08ef520bafda596b1c",
"assets/assets/data/tree_rule_low.json": "55be0ee89eb1cc85ffd38409a8e88ed9",
"assets/assets/data/tree_rule_middle.json": "3c187b5e448e95fc67f2d97ec8eb4240",
"assets/assets/images/empty.png": "088861ccdbac26b026e0843cbb93aa71",
"assets/assets/images/icon_ai.png": "6ff59f134c84ca509adfabe8ad27a24a",
"assets/assets/images/icon_dy.png": "e68fe851f4aa3f5d07f39f30c1afc582",
"assets/assets/images/icon_edit.png": "2f57947eb22f0ee3a0af06e2dbda16ca",
"assets/assets/images/icon_tool.png": "1fae845cc8b7c91168ba7f7a0e8ecafb",
"assets/assets/images/icon_video_play.png": "a761c2c8924bc4f06991e4cd8334d47d",
"assets/assets/images/icon_xhs.png": "656a053ea17db92ac6317de932366e8e",
"assets/assets/images/img_divider.png": "358ab25af8dc91d98951490612c42b59",
"assets/assets/images/img_logo.png": "ea2c0b8a10661b3576b40e4475d2e477",
"assets/assets/images/img_su_dou.png": "58e5ec2cf9bedb541c7dab57e4a0d83b",
"assets/assets/images/img_su_hong.png": "6c786588118e661fcfa2d8cfe3900dbe",
"assets/assets/images/img_su_video.png": "52f83886b3ec77b3cb3c479078b2ee48",
"assets/assets/images/nav_data.png": "e8670b5f320936cf7bed2f413c300149",
"assets/assets/images/nav_data_select.png": "421ba2fdcbd7b26506d810edbedfa236",
"assets/assets/images/nav_share.png": "5bf67420b6d7887bff1b46be93a99c91",
"assets/assets/images/nav_share_select.png": "64104e37e2a2472a4711b9b38757c2c9",
"assets/assets/images/nav_word.png": "f9854856289fcbc25a0b5f135f3fb464",
"assets/assets/json/Animation%2520-%25201709021523588.json": "76ddcd2f607b7dfa30a4bd53d3d2d6fc",
"assets/assets/json/error.json": "83e49b0baf6e2cc3329ac58c35907c15",
"assets/FontManifest.json": "dc3d03800ccca4601324923c0b1d6d57",
"assets/fonts/MaterialIcons-Regular.otf": "27764afdba22f0610b6984054dd1d8c1",
"assets/NOTICES": "e011750e7fd5b1bdf6b2e44c4656fb9b",
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "60114762957c6a50d2e0cd7d2c5b7b98",
"assets/packages/wakelock_plus/assets/no_sleep.js": "7748a45cd593f33280669b29c2c8919a",
"assets/shaders/ink_sparkle.frag": "f8b80e740d33eb157090be4e995febdf",
"canvaskit/canvaskit.js": "76f7d822f42397160c5dfc69cbc9b2de",
"canvaskit/canvaskit.wasm": "f48eaf57cada79163ec6dec7929486ea",
"canvaskit/chromium/canvaskit.js": "8c8392ce4a4364cbb240aa09b5652e05",
"canvaskit/chromium/canvaskit.wasm": "fc18c3010856029414b70cae1afc5cd9",
"canvaskit/skwasm.js": "1df4d741f441fa1a4d10530ced463ef8",
"canvaskit/skwasm.wasm": "6711032e17bf49924b2b001cef0d3ea3",
"canvaskit/skwasm.worker.js": "19659053a277272607529ef87acf9d8a",
"favicon.png": "5dcef449791fa27946b3d35ad8803796",
"flutter.js": "6b515e434cea20006b3ef1726d2c8894",
"icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
"icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
"icons/Icon-maskable-192.png": "c457ef57daa1d16f64b27b786ec2ea3c",
"icons/Icon-maskable-512.png": "301a7604d45b3e739efc881eb04896ea",
"index.html": "45dd7e7de7d3f9a4a6eb162954ea1992",
"/": "45dd7e7de7d3f9a4a6eb162954ea1992",
"main.dart.js": "4b25d60a1307ed30c56fe05ecb825ef7",
"manifest.json": "9451c9006c9a385f0f973f579575c6b0",
"version.json": "f4565e693e6d35a34454b99c9b92ed2b"};
// The application shell files that are downloaded before a service worker can
// start.
const CORE = ["main.dart.js",
"index.html",
"assets/AssetManifest.json",
"assets/FontManifest.json"];

// During install, the TEMP cache is populated with the application shell files.
self.addEventListener("install", (event) => {
  self.skipWaiting();
  return event.waitUntil(
    caches.open(TEMP).then((cache) => {
      return cache.addAll(
        CORE.map((value) => new Request(value, {'cache': 'reload'})));
    })
  );
});
// During activate, the cache is populated with the temp files downloaded in
// install. If this service worker is upgrading from one with a saved
// MANIFEST, then use this to retain unchanged resource files.
self.addEventListener("activate", function(event) {
  return event.waitUntil(async function() {
    try {
      var contentCache = await caches.open(CACHE_NAME);
      var tempCache = await caches.open(TEMP);
      var manifestCache = await caches.open(MANIFEST);
      var manifest = await manifestCache.match('manifest');
      // When there is no prior manifest, clear the entire cache.
      if (!manifest) {
        await caches.delete(CACHE_NAME);
        contentCache = await caches.open(CACHE_NAME);
        for (var request of await tempCache.keys()) {
          var response = await tempCache.match(request);
          await contentCache.put(request, response);
        }
        await caches.delete(TEMP);
        // Save the manifest to make future upgrades efficient.
        await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
        // Claim client to enable caching on first launch
        self.clients.claim();
        return;
      }
      var oldManifest = await manifest.json();
      var origin = self.location.origin;
      for (var request of await contentCache.keys()) {
        var key = request.url.substring(origin.length + 1);
        if (key == "") {
          key = "/";
        }
        // If a resource from the old manifest is not in the new cache, or if
        // the MD5 sum has changed, delete it. Otherwise the resource is left
        // in the cache and can be reused by the new service worker.
        if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
          await contentCache.delete(request);
        }
      }
      // Populate the cache with the app shell TEMP files, potentially overwriting
      // cache files preserved above.
      for (var request of await tempCache.keys()) {
        var response = await tempCache.match(request);
        await contentCache.put(request, response);
      }
      await caches.delete(TEMP);
      // Save the manifest to make future upgrades efficient.
      await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
      // Claim client to enable caching on first launch
      self.clients.claim();
      return;
    } catch (err) {
      // On an unhandled exception the state of the cache cannot be guaranteed.
      console.error('Failed to upgrade service worker: ' + err);
      await caches.delete(CACHE_NAME);
      await caches.delete(TEMP);
      await caches.delete(MANIFEST);
    }
  }());
});
// The fetch handler redirects requests for RESOURCE files to the service
// worker cache.
self.addEventListener("fetch", (event) => {
  if (event.request.method !== 'GET') {
    return;
  }
  var origin = self.location.origin;
  var key = event.request.url.substring(origin.length + 1);
  // Redirect URLs to the index.html
  if (key.indexOf('?v=') != -1) {
    key = key.split('?v=')[0];
  }
  if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
    key = '/';
  }
  // If the URL is not the RESOURCE list then return to signal that the
  // browser should take over.
  if (!RESOURCES[key]) {
    return;
  }
  // If the URL is the index.html, perform an online-first request.
  if (key == '/') {
    return onlineFirst(event);
  }
  event.respondWith(caches.open(CACHE_NAME)
    .then((cache) =>  {
      return cache.match(event.request).then((response) => {
        // Either respond with the cached resource, or perform a fetch and
        // lazily populate the cache only if the resource was successfully fetched.
        return response || fetch(event.request).then((response) => {
          if (response && Boolean(response.ok)) {
            cache.put(event.request, response.clone());
          }
          return response;
        });
      })
    })
  );
});
self.addEventListener('message', (event) => {
  // SkipWaiting can be used to immediately activate a waiting service worker.
  // This will also require a page refresh triggered by the main worker.
  if (event.data === 'skipWaiting') {
    self.skipWaiting();
    return;
  }
  if (event.data === 'downloadOffline') {
    downloadOffline();
    return;
  }
});
// Download offline will check the RESOURCES for all files not in the cache
// and populate them.
async function downloadOffline() {
  var resources = [];
  var contentCache = await caches.open(CACHE_NAME);
  var currentContent = {};
  for (var request of await contentCache.keys()) {
    var key = request.url.substring(origin.length + 1);
    if (key == "") {
      key = "/";
    }
    currentContent[key] = true;
  }
  for (var resourceKey of Object.keys(RESOURCES)) {
    if (!currentContent[resourceKey]) {
      resources.push(resourceKey);
    }
  }
  return contentCache.addAll(resources);
}
// Attempt to download the resource online before falling back to
// the offline cache.
function onlineFirst(event) {
  return event.respondWith(
    fetch(event.request).then((response) => {
      return caches.open(CACHE_NAME).then((cache) => {
        cache.put(event.request, response.clone());
        return response;
      });
    }).catch((error) => {
      return caches.open(CACHE_NAME).then((cache) => {
        return cache.match(event.request).then((response) => {
          if (response != null) {
            return response;
          }
          throw error;
        });
      });
    })
  );
}
